package com.study.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

import com.study.util.DynamicDataSource;


@Configuration
public class TransactionConfig {
	
	@Autowired
	DynamicDataSource dynamicDataSource;
	
	@Bean
	public DataSourceTransactionManager dataSourceTransactionManager() {
		DataSourceTransactionManager manager = new DataSourceTransactionManager();
		manager.setDataSource(dynamicDataSource);
		return manager;
	}

}
